<template>
  <div>
    <shop-header></shop-header>
    <shop-tab></shop-tab>
  </div>
</template>

<script>
import { reqShopInfo } from '../api/index'
import shopTab from '../components/shop/shopTab.vue'
import shopHeader from '../components/shop/shopHeader.vue'
export default {
  components: { shopHeader, shopTab },
  data() {
    return {}
  },
  methods: {
    // 获取商家信息
    async getShoperInfo() {
      const res = await reqShopInfo()
      const resGoodsInfo = res.info
      const resGoods = res.goods
      const resGoodsRetings = res.ratings
      this.$store.dispatch('getShopLisAsync', resGoodsInfo)
      this.$store.dispatch('getGoodsRatingsAsync', resGoodsRetings)
      this.$store.dispatch('getGoodsAsync', resGoods)
    }
  },
  mounted() {
    this.getShoperInfo()
  }
}
</script>
<style lang="less" scoped></style>
